/*
 * MapTile.h
 *
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses 
 */

#ifndef MAPTILE_H_
#define MAPTILE_H_

#include "MapObject.h"
#include "MapEffect.h"

// Modela un casillero del mapa

class MapTile {
private:
    MapObject* object;
    MapObject* dropedObject;

public:
    MapTile();
    // Si el casillero está ocupado al insertar un nuevo objeto, hace que
    // estos colisionen. Remueve el objeto que estaba, coloca el nuevo y
    // devuelve true si la colisión se resuelve a favor del nuevo objeto. No
    // modifica su estado y devuelve false en caso contrario. Chequea colisión
    // contra el drop, si hubiera uno, y procede igual que si solo hubiera
    // estado un objeto
    bool insertObject(MapObject* object);
    bool dropObject(MapObject* object);
    MapObject* getObject();
    MapObject* getDropedObject();
    MapObject* removeObject();
    bool objectDropedOn();
    MapObject* removeDropedObject();
    void applyEffect(MapEffect* effect);
    bool isOccupied();
    ~MapTile();
};

#endif /* MAPTILE_H_ */
